import {createRouter,createWebHistory} from "vue-router";

const routes = [
    {path: '/',redirect:'index'},
    {path:'/index',name:'index',component:()=>import('../pages/index.vue')},
    {path:'/userList',name:'userList',component:()=>import('../pages/UserList.vue'),
        children:[
            {path:'/userList/userUpdate/:id',name:'userUpdate',props:true,component:()=>import('../pages/UserUpdate.vue')}
        ]
    },
    {path: '/userAdd',name: 'userAdd',component:()=>import('../pages/UserAdd.vue')},
    {path: '/upload',name: 'upload',component:()=>import('../pages/Upload.vue')}
]

const router = createRouter({
    history:createWebHistory(),
    routes:routes
})

export default router